

function setStorageBool() {
    NativeStorage.putBoolean("keyBool", false, function(info){
        document.getElementById("boolInfo").innerHTML = info;
    },function(error){
        document.getElementById("boolInfo").innerHTML = error;
    })
}

function getStorageBool() {
    NativeStorage.getBoolean("keyBool", function(info){
        document.getElementById("boolInfo2").innerHTML = info;
    },function(error){
        document.getElementById("boolInfo2").innerHTML = error;
    })
}

function setStorageNumber() {
    NativeStorage.putInt("keyInt", 123, function(info){
        document.getElementById("numberInfo").innerHTML = info;
    },function(error){
        document.getElementById("numberInfo").innerHTML = error;
    })
}

function getStorageNumber() {
    NativeStorage.getInt("keyInt", function(info){
        document.getElementById("numberInfo2").innerHTML = info;
    },function(error){
        document.getElementById("numberInfo2").innerHTML = error;
    })
}

function setStorageDouble() {
    NativeStorage.putDouble("keyDouble", 123.1234, function(info){
        document.getElementById("doubleInfo").innerHTML = info;
    },function(error){
        document.getElementById("doubleInfo").innerHTML = error;
    })
}

function getStorageDouble() {
    NativeStorage.getDouble("keyDouble", function(info){
        document.getElementById("doubleInfo2").innerHTML = info;
    },function(error){
        document.getElementById("doubleInfo2").innerHTML = error;
    })
}

function setStorageString() {
    NativeStorage.putString("keyString", "hello world", function(info){
        document.getElementById("stringInfo").innerHTML = info;
    },function(error){
        document.getElementById("stringInfo").innerHTML = error;
    })
}

function getStorageString() {
    NativeStorage.getString("keyString", function(info){
        document.getElementById("stringInfo2").innerHTML = info;
    },function(error){
        document.getElementById("stringInfo2").innerHTML = error;
    })
}

function setStorageItem() {
    var obj = {name: "NativeStorage", author: "GillesCallebaut"};
    NativeStorage.putObject("keyItem", obj, function(info){
        document.getElementById("itemInfo").innerHTML = info;
    },function(error){
        document.getElementById("itemInfo").innerHTML = error;
    })
}

function getStorageItem() {
    NativeStorage.getObject("keyItem", function(info){
        document.getElementById("itemInfo2").innerHTML = info;
    },function(error){
        document.getElementById("itemInfo2").innerHTML = error;
    })
}

function getStorageAll() {
    NativeStorage.keys(function(info){
        document.getElementById("allInfo").innerHTML = JSON.stringify(info);
    },function(error){
        document.getElementById("allInfo").innerHTML = error;
    })
}

function delStorage() {
    NativeStorage.remove("keyItem", function(){
        document.getElementById("deleteInfo").innerHTML = "删除成功";
    },function(error){
        document.getElementById("deleteInfo").innerHTML = error;
    })
}

function clearStorage() {
    NativeStorage.clear(function(){
        document.getElementById("clearInfo").innerHTML = "清除成功";
    },function(error){
        document.getElementById("clearInfo").innerHTML = error;
    })
}
